


var fs = require('fs');


// 读取超大文件   图片 / html 
// 文件流形式读写 

var zlib = require('zlib');


var fileread = fs.createReadStream('./nodeapi.html', { encoding: 'utf8' });
// var filewrite = fs.createWriteStream('./data/nodeapi_1.html.gz', { encoding: 'utf8' });
var filewrite = fs.createWriteStream('./data/nodeapi.html', { encoding: 'utf8' });


fileread
    // .pipe(zlib.createGzip())   // node 文件压缩 
    .pipe(filewrite);//pipe 管道输送大型文件内容 


